home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 25 / AMIGAplus Sonderheft 25 (2000)(Falke)(DE)(Track 1 of 4)[!].iso / Updates / HD-Installer / jst_dev / sources / src / loaders / AllTerrainRacing / atrhd.asm next >
Assembly Source File  |  2000-04-12  |  1KB  |  108 lines

  1. ; *** ATR HD Loader
  2. ; *** Written by Jean-François Fabre (jffabre@ensica.fr)
  3.  
  4.     include    "jst.i"
  5.  
  6.     HD_PARAMS    "ATR.d",STD_DISK_SIZE,2
  7.  
  8.  
  9. loader:
  10.     move.l    #$80000,D0
  11.     JSRABS    AllocExtMem
  12.     RELOC_MOVEL    D0,ExtBase
  13.     beq    MemErr
  14.  
  15.     Mac_printf    "ATR HD Loader V1.1"
  16.     Mac_printf    "Coded by Jean-Francois Fabre © 1996/1997"
  17.  
  18.     JSRABS    LoadDisks
  19.  
  20.     move.l    #CACRF_CopyBack,D1
  21.     moveq.l    #0,D0
  22.     JSRABS    Degrade
  23.  
  24. ;    WAIT_LMB
  25.  
  26.     GO_SUPERVISOR
  27.     SAVE_OSDATA    $80000
  28.  
  29.     PATCHGENJMP    $C0,InGameExit
  30.  
  31.     bsr    InstallBoot
  32.  
  33.  
  34.     JSRGEN    FlushCachesHard
  35.     move.l    ExtBase(pc),$F00.W
  36.     jmp    $78034
  37.  
  38. PatchLoader1:
  39.     PATCHUSRJSR    $17E4.W,kbint
  40.     PATCHUSRJSR    $11A2A,SetDisk2
  41.     PATCHUSRJMP    $8D96,Patch2
  42.     PATCHUSRJMP    $58F0.W,ReadSectors
  43.  
  44.     JSRGEN    GoECS
  45.     JSRGEN    FlushCachesHard
  46.     nop
  47.     nop
  48.     jmp    $1000.W
  49.     nop
  50.     nop
  51.  
  52. Patch2:
  53.     move.l    #$6A616D69,$6BC00
  54.     move.l    #$65313233,$6BC04
  55.     jmp    $8DBA
  56.  
  57. InstallBoot:
  58.     lea    $78000,A0
  59.     move.l    #$1200,D1
  60.     move.l    #$400,D2
  61.     moveq    #0,D0
  62.     JSRGEN    ReadDiskPart
  63.  
  64.     PATCHUSRJMP    $787A2,ReadSectors
  65.     PATCHUSRJMP    $78096,PatchLoader1
  66.     rts
  67.  
  68.  
  69. MemErr:
  70.     Mac_printf    "** Not enough memory to run ATR"
  71.     JMPABS    CloseAll
  72.  
  73. ReadSectors:
  74.     moveq.l    #0,D0
  75.     move.w    currdisk(pc),D0
  76.     JSRGEN    ReadRobSectors
  77.     rts
  78.  
  79.     cnop    0,4
  80. SetDisk2:
  81.     lea    currdisk(pc),A1
  82.     move.w    #1,(A1)
  83.     rts
  84.  
  85.  
  86. kbint:
  87.     move.b    $C00(A0),D0
  88.     not.b    D0
  89.  
  90.     move.l    D0,-(sp)
  91.  
  92.     ror.b    #1,D0
  93.     cmp.b    #$59,D0
  94.     bne    kbend
  95.  
  96.     ; *** try to quit
  97.  
  98.     JSRGEN    InGameExit
  99.  
  100. kbend:
  101.     move.l    (sp)+,D0
  102.     rts
  103.  
  104. ExtBase:
  105.     dc.l    0
  106. currdisk:
  107.     dc.l    0
  108.